package edu.ucsc.gameAI.conditions;

import pacman.game.Game;
import pacman.game.Constants.GHOST;
import edu.ucsc.gameAI.ICondition;
import edu.ucsc.gameAI.PacmanConstants;

public class AreAnyGhostsEdibleAndNoDangerousGhostNearby implements ICondition {
	
	public boolean test(Game game) 
	{
		//Debug.debug("AreAnyGhostsEdible", MESSAGETYPE.CONDITION);
		if (new NoDangerousGhostsNearby().test(game)) {
			for (GHOST ghost: GHOST.values()){
				if(game.isGhostEdible(ghost))
					return true; // return true as soon as we've confirmed at least one ghost is edible and very close.
			}
		}
		return false;
	}
}